package com.zbkj.dal.entity.user;

import lombok.Data;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author JinXinyu
 * @date 2024-03-19 21:16:57
 */
@Data
@TableName("eb_employee")
public class Employee implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @TableField("id")
    private Integer id;

    /**
     * 工号
     */
    @TableField("employee_no")
    private String employeeNo;

    /**
     * 用户名称
     */
    @TableField("user_name")
    private String userName;

    /**
     * 用户名称
     */
    @TableField("real_name")
    private String realName;

    /**
     * 手机号
     */
    @TableField("mobile")
    private String mobile;

    /**
     * 员工职位
     */
    @TableField("employee_position")
    private String employeePosition;

    /**
     * 企微账户
     */
    @TableField("wx_work_account")
    private String wxWorkAccount;

    /**
     * 状态
     * @see com.zbkj.dal.base.enums.EmployeeStatusEnum
     */
    private String status;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 是否删除
     */
    @TableField("is_deleted")
    private Integer deleted;

    public static String generateEmployeeNo(Integer id) {
        return 1 + String.format("%04d", id);
    }
}
